Editor Api
Functions
Adds a new history state to the stack, if undoable changes were made.
Add a new vertex by splitting the segment after the currently selected vector node.
Inspects a resource header/container and reports image, audio, and video support separately. Downloads the resource if needed. This does not guarantee a complete decode or profile support. Container results cover retained tracks; the demuxer can drop unsupported source tracks. This call starts no codec probes. Unmeasured families remain unchecked.
Throws an exception if the device does not support displaying and working in the P3 color space on the current device. If no exception is thrown, the engine can be switched to a P3 color space using the "features/p3WorkingColorSpace" setting.
Converts a color to the given color space. In Managed scenes, converting sRGB colors or RGB-only spot approximations to CMYK uses the document or fallback CMYK profile. While the required profile loads from a URI, this conversion throws COLOR.PROFILE_NOT_LOADED. Await loadColorProfiles first. RGB-to-CMYK conversion uses a simple formula if the profile only converts CMYK to RGB or cannot load.
Create a resizable buffer that can hold arbitrary data.
This is the default implementation for the Uri resolver. If uri is absolute no adjustments are made. If it is relative, it resolves the given Uri relative to the basePath setting, which is "file:///android_asset" by default (assets base uri).
Delete the selected vector control points.
Delete the currently selected vector node from the path.
Destroy a buffer and free its resources.
Destroy the given history, returns an error if the handle doesn't refer to a history.
Returns all media URIs referenced by blocks in the scene. Note: This function retrieves URIs from image fills, video fills, and audio blocks, including their source sets. Only returns valid media URIs (http://, https://, file://), excluding transient resources like buffer URIs. Useful for determining which media files are referenced by a scene (e.g., for cleanup operations, CDN management).
Gets all available global scopes that can be set.
Returns a list of all the settings available.
Queries the names of currently set spot colors previously set with setSpotColor`.
Returns the Uris and sizes of all resources whose data would be lost if the scene was exported. Note: This function is useful for determining which resources need to be relocated (e.g., to a CDN) before exporting a scene since the resources are not included in the exported scene.
Resolves the given uri asynchronously. If a custom resolver has been set with setUriResolver, it uses the custom resolver. Else, it resolves using defaultUriResolver.
Get the handle to the currently active history. If there's none it will be created.
Get the active license of the engine.
Get the currently available memory in bytes.
Get the data of a buffer.
Get the length of a buffer.
Get the current edit mode of the editor. An edit mode defines what type of content can currently be edited by the user.
Returns the engine media catalog for this runtime. Support describes known decoder families, not a complete decode or external design importer. Results reflect current feature settings and codec measurements. This call starts no probes. Unmeasured codec families remain unchecked.
Returns the names, weight, style, variation axes and OpenType features of a font file. The call loads the font when it is not loaded yet. The result describes the default instance of a variable font, and the call ignores a fragment that names axis values, such as #wght=700. Use the result to register an uploaded font on a typeface asset source.
Returns the font metrics for a given font file URI. If the font is not yet loaded, it will be fetched asynchronously. The returned metrics are in the font's design units coordinate space. Missing or zero underline metrics use the defaults documented in FontMetrics.
Query the state of a global scope.
Get the export size limit in pixels on the current device. It bounds a color mask export. It also bounds each image, gradient and effect that a PDF export draws as pixels at the scene DPI, not the page. Both sides must be below or equal to it. An export might still fail for other reasons, such as memory. The limit is at most 23170 px, the side of the largest square export whose pixels fit in 2 GiB. A PNG, JPEG, WebP, TGA or raw export renders in strips, so this limit does not bound it. Only the side limit of its format does: JPEG 65500, WebP 16383 and TGA 65535 px. A buffered export must also give a file under 4 GiB. A PNG or JPEG export with outputProfileMode or embedProfiles renders in one surface, so this limit bounds it.
Returns the mimetype of the resources at the given Uri. If the resource is not already downloaded, this function will download it.
Get when the standalone move handle is shown for the selected block.
Get the effective movement constraint for a block, picking the most specific matching rule: block page slice parent page blockType scene-wide.
Get when the edge (resize) handles are shown for the selected block.
Provides the data of a resource at the given Uri. Note that it is a synchronous function and all the chunks are provided immediately before the function returns.
Get when the rotation handle is shown for the selected block.
Get when the corner (scale) handles are shown for the selected block.
Get the bezier handle mirror mode of the currently selected vector node.
Get a boolean setting.
Get a color setting.
Get a double setting.
Get an enum setting.
Get all the available options of an enum setting.
Get a float setting.
Get an integer setting.
Get a string setting.
Get the type of a setting.
Get the color space that soft proofing simulates.
Queries the RGB representation set for a spot color. If the value of the queried spot color has not been set yet, returns the default RGB representation (of magenta). The alpha value is always 1.0.
Queries the CMYK representation set for a spot color. If the value of the queried spot color has not been set yet, returns the default RGB representation (of magenta).
Queries the RGB representation set for a spot color. If the value of the queried spot color has not been set yet, returns the default RGB representation (of magenta). The alpha value is always 1.0.
Get the current text cursor's x position in screen space.
Get the current text cursor's y position in screen space.
Get the current memory usage of the editor in bytes.
Check whether vector edit add mode is currently active.
Check whether vector edit bend mode is currently active.
Check whether vector edit delete mode is currently active.
Check if there is a selected vector control point.
Check whether a vector anchor node is currently selected in vector edit mode.
Checks wether the block has selection and hover highlighting enabled or disabled.
If an user interaction is happening, e.g., a resize edit with a drag handle or a touch gesture.
Checks whether the block can currently be selected.
Check whether soft proofing of the live canvas is on.
Loads the CMYK profile used for managed color conversion and preview.
Loads the color profiles used for managed color conversion and preview. Waits for every profile the document names, and for the effective Default/CMYK profile, including the configured or bundled fallback. Only the Default/CMYK result decides the outcome: a profile of another slot that fails to load is logged and does not fail the call. Configuration changes during loading are resolved before completion. Call again after later changes. Returns immediately when every profile the document names is already loaded. Coroutine cancellation ends this wait; the profile keeps loading for color conversion.
Subscribe to current page changes when page carousel mode is enabled. Note: This is only triggered when page carousel mode is enabled (features/pageCarouselEnabled).
Subscribe to changes to the undo/redo history.
Subscribe to changes to the editor role.
Subscribe to changes to the editor settings.
Subscribe to changes to the editor state.
Free the memory that the engine can build again without a download. The engine frees the decoded images that the canvas did not draw last, and the video thumbnails. It also frees the files that no block uses, and the unused GPU textures. The files that blocks use stay, so no file downloads again. The next frames decode the freed images again when they need them. The engine calls it on its own when the system reports low memory or moves the app to the background. From Android 14 the system reports no low memory to an app in the foreground, so call it there yourself.
Changes the uri associated with a resource. Note: This function can be used change the Uri of a resource that has been relocated (e.g., to a CDN). Relocating the Uri of a document color profile also repoints the profile. A setDocumentColorProfile request for that Uri that is still loading commits the new Uri once it loads.
Remove the scene-wide default movement constraint. Removing a scope falls through to the next tier on subsequent resolution.
Remove multiple movement constraint scopes at once. An empty list is a no-op; use removeMovementConstraint with no arguments to remove the scene-wide default.
Remove the movement constraint for a specific scope. Removing a scope falls through to the next tier on subsequent resolution.
Removes a spot color from the list of set spot colors.
Removes the last history state from the stack, if available.
Mark the given history as active, returns an error if the handle doesn't refer to a history. All other histories get cleared from the active state. Undo/redo operations only apply to the active history. A new history starts from the current scene, including edits without an undo step and the selection; returning to a history restores its last undo step. Setting a history that is not new as active, also the active one, discards edits without an undo step. Edits with an undo step stay in the history they were made in.
Inform the engine that the app went to the background when paused. A pause frees the audio and video decoders, and the memory that releaseMemory frees. So after a resume, the first frames upload their textures again and make the video thumbnails again. The audio output device will be suspended on pause. It starts again automatically as soon as a block is playing or can be started manually with startAudioOutputDevice.
Set the data of a buffer.
Set the length of a buffer.
Set the edit mode of the editor. An edit mode defines what type of content can currently be edited by the user. Note: The initial edit mode is "Transform".
Set the edit mode of the editor using another edit mode as a base. An edit mode defines what type of content can currently be edited by the user.
Set a scope to be globally allowed, denied, or deferred to the block-level.
Enable or disable selection and hover highlighting for a block.
Set when the standalone move handle is shown for the selected block.
Set multiple movement constraint rules at once. See setMovementConstraint for details on a single rule.
Set a rule that limits how far blocks can be positioned outside their parent page during user interactions (drag, resize, touch gestures, crop, nudge). Programmatic API calls are not affected.
Set when the edge (resize) handles are shown for the selected block.
Set when the rotation handle is shown for the selected block.
Set when the corner (scale) handles are shown for the selected block.
Set the bezier handle mirror mode for the currently selected vector node.
Enable or disable selection for a block.
Set a boolean setting.
Set a color setting.
Set a double setting.
Set an enum setting.
Set a float setting.
Set an integer setting.
Set a string setting.
Set the color space that soft proofing simulates. The proof uses the Output profile of that space, then its Default profile, then the fallback profile. Creating or loading a scene, or applying a template, sets the color space to ProfileColorSpace.CMYK. A setActiveHistory call that switches to another scene does the same by the next update. A change emits on onStateChanged.
Turn soft proofing of the live canvas on or off. With proofing on, the artwork inside the visible page trims shows the colors of the output profile of getSoftProofColorSpace. Exports, thumbnails, bleed and editor decorations stay unproofed. The state is not saved with the scene, and undo does not change it. Creating or loading a scene, or applying a template, turns proofing off and sets the color space to ProfileColorSpace.CMYK. A setActiveHistory call that switches to another scene does the same by the next update. A change emits on onStateChanged.
Sets the CMYK representation of a spot color. Use this function to both create a new spot color or update an existing spot color.
Sets the RGB representation of a spot color. Use this function to both create a new spot color or update an existing spot color. Note: The alpha value is ignored.
Sets the resolver for opt-in runtime font requests. Pass null to restore asset-source resolution. Returning null or throwing makes the engine use the default font, and the request reports substituted. The engine retains the original request through scene load/save and waits for resolution in resource readiness.
Sets a custom Uri resolver. This method can be called more than once. Subsequent calls will overwrite previous calls. To remove a previously set resolver, pass the value null. Note: The given function must return an absolute path with a scheme.
Sets a custom async Uri resolver. This method can be called more than once. Subsequent calls will overwrite previous calls. To remove a previously set resolver, pass the value null.
Enable or disable add mode for vector editing.
Enable or disable bend mode for vector editing.
Enable or disable delete mode for vector editing.
Start the audio output device. Usually not needed as the device will automatically start when a block is set to playing. Useful to call when the app is resumed and you want to ensure audio playback is resumed as well. Can also be used to manually start the audio output device, e.g., before a recording.
Returns whether the engine supports displaying and working in the P3 color space on the current device. If supported, the engine can be switched to a P3 color space using the "features/p3WorkingColorSpace" setting.
Toggle the currently selected vector node between smooth (bezier handles) and corner (no handles).